angular.module('home',[])
.config(['$routeProvider',function($routeProvider){
	$routeProvider
	.when('/home',{
		templateUrl:'html/home/home.html',
		css:'html/home/home.css'
	})
}])
.controller('homeCtrl',function($scope,$http,$rootScope){
	//头部和底部显示隐藏
	$rootScope.sh = true;
	$http.get('http://www.yanhanbo.top/user/index.php?names=&imgs=&ms=&price=&prices=&type=%E6%89%80%E6%9C%89').then(function(data){
		$scope.data = data.data.data.splice(0,9);
		$scope.data1 = data.data.data.splice(0,10);
		$scope.data2 = data.data.data.splice(0,10);
		$scope.data3 = data.data.data.splice(0,10);
		$scope.data4 = data.data.data.splice(0,10);
	})
	//点击进入详情页
	$rootScope.arr2 = [];
	$scope.dianji = function(x){
		$rootScope.arr2.push(x);
		localStorage.arrr = JSON.stringify($rootScope.arr2);
	}
	
	$http.get('http://www.yanhanbo.top/user/origin.php?names=&imgs=&standard=&genre=&delivery=&price=&type=%E6%89%80%E6%9C%89').then(function(data){
		$rootScope.kk = data.data.data;
		
	})
	$scope.listclick1 = function(index){
		$rootScope.Sarr = [];
		for(var i=0;i<$rootScope.kk.length;i++){
			$scope.data = $rootScope.List1[index];
			if($scope.data == $rootScope.kk[i]['genre']){
				$rootScope.Sarr.push($rootScope.kk[i]);
			}
		}
	}
	$scope.listclick2 = function(index){
		$rootScope.Sarr = [];
		for(var i=0;i<$rootScope.kk.length;i++){
			$scope.data = $rootScope.List2[index];
			if($scope.data == $rootScope.kk[i]['genre']){
				$rootScope.Sarr.push($rootScope.kk[i]);
			}
		}
	}
	$scope.listclick3 = function(index){
		$rootScope.Sarr = [];
		for(var i=0;i<$rootScope.kk.length;i++){
			$scope.data = $rootScope.List3[index];
			if($scope.data == $rootScope.kk[i]['genre']){
				$rootScope.Sarr.push($rootScope.kk[i]);
			}
		}
	}
	$scope.listclick4 = function(index){
		$rootScope.Sarr = [];
		for(var i=0;i<$rootScope.kk.length;i++){
			$scope.data = $rootScope.List4[index];
			if($scope.data == $rootScope.kk[i]['genre']){
				$rootScope.Sarr.push($rootScope.kk[i]);
			}
		}
	}
	$scope.listclick5 = function(index){
		$rootScope.Sarr = [];
		for(var i=0;i<$rootScope.kk.length;i++){
			$scope.data = $rootScope.List5[index];
			if($scope.data == $rootScope.kk[i]['genre']){
				$rootScope.Sarr.push($rootScope.kk[i]);
			}
		}
	}
	$scope.listclick6 = function(index){
		$rootScope.Sarr = [];
		for(var i=0;i<$rootScope.kk.length;i++){
			$scope.data = $rootScope.List6[index];
			if($scope.data == $rootScope.kk[i]['genre']){
				$rootScope.Sarr.push($rootScope.kk[i]);
			}
		}
	}
	$scope.listclick7 = function(index){
		$rootScope.Sarr = [];
		for(var i=0;i<$rootScope.kk.length;i++){
			$scope.data = $rootScope.List7[index];
			if($scope.data == $rootScope.kk[i]['genre']){
				$rootScope.Sarr.push($rootScope.kk[i]);
			}
		}
	}
	$scope.listclick8 = function(index){
		$rootScope.Sarr = [];
		for(var i=0;i<$rootScope.kk.length;i++){
			$scope.data = $rootScope.List8[index];
			if($scope.data == $rootScope.kk[i]['genre']){
				$rootScope.Sarr.push($rootScope.kk[i]);
			}
		}
	}
	$scope.listclick9 = function(index){
		$rootScope.Sarr = [];
		for(var i=0;i<$rootScope.kk.length;i++){
			$scope.data = $rootScope.List9[index];
			if($scope.data == $rootScope.kk[i]['genre']){
				$rootScope.Sarr.push($rootScope.kk[i]);
			}
		}
	}
	$scope.listclick10 = function(index){
		$rootScope.Sarr = [];
		for(var i=0;i<$rootScope.kk.length;i++){
			$scope.data = $rootScope.List10[index];
			if($scope.data == $rootScope.kk[i]['genre']){
				$rootScope.Sarr.push($rootScope.kk[i]);
			}
		}
	}
	
	$scope.listclick11 = function(index){
		$rootScope.Sarr = [];
		for(var i=0;i<$rootScope.kk.length;i++){
			$scope.data = $rootScope.List11[index];
			if($scope.data == $rootScope.kk[i]['genre']){
				$rootScope.Sarr.push($rootScope.kk[i]);
			}
		}
	}
	$scope.listclick12 = function(index){
		$rootScope.Sarr = [];
		for(var i=0;i<$rootScope.kk.length;i++){
			$scope.data = $rootScope.List12[index];
			if($scope.data == $rootScope.kk[i]['genre']){
				$rootScope.Sarr.push($rootScope.kk[i]);
			}
		}
	}
	$scope.listclick13 = function(index){
		$rootScope.Sarr = [];
		for(var i=0;i<$rootScope.kk.length;i++){
			$scope.data = $rootScope.List13[index];
			if($scope.data == $rootScope.kk[i]['genre']){
				$rootScope.Sarr.push($rootScope.kk[i]);
			}
		}
	}
	$scope.listclick14 = function(index){
		$rootScope.Sarr = [];
		for(var i=0;i<$rootScope.kk.length;i++){
			$scope.data = $rootScope.List14[index];
			if($scope.data == $rootScope.kk[i]['genre']){
				$rootScope.Sarr.push($rootScope.kk[i]);
			}
		}
	}
	$scope.listclick15 = function(index){
		$rootScope.Sarr = [];
		for(var i=0;i<$rootScope.kk.length;i++){
			$scope.data = $rootScope.List15[index];
			if($scope.data == $rootScope.kk[i]['genre']){
				$rootScope.Sarr.push($rootScope.kk[i]);
			}
		}
	}
	$scope.listclick16 = function(index){
		$rootScope.Sarr = [];
		for(var i=0;i<$rootScope.kk.length;i++){
			$scope.data = $rootScope.List16[index];
			if($scope.data == $rootScope.kk[i]['genre']){
				$rootScope.Sarr.push($rootScope.kk[i]);
			}
		}
	}
	$scope.listclick17 = function(index){
		$rootScope.Sarr = [];
		for(var i=0;i<$rootScope.kk.length;i++){
			$scope.data = $rootScope.List17[index];
			if($scope.data == $rootScope.kk[i]['genre']){
				$rootScope.Sarr.push($rootScope.kk[i]);
			}
		}
	}
	$scope.listclick18 = function(index){
		$rootScope.Sarr = [];
		for(var i=0;i<$rootScope.kk.length;i++){
			$scope.data = $rootScope.List18[index];
			if($scope.data == $rootScope.kk[i]['genre']){
				$rootScope.Sarr.push($rootScope.kk[i]);
			}
		}
	}
	$scope.listclick19 = function(index){
		$rootScope.Sarr = [];
		for(var i=0;i<$rootScope.kk.length;i++){
			$scope.data = $rootScope.List19[index];
			if($scope.data == $rootScope.kk[i]['genre']){
				$rootScope.Sarr.push($rootScope.kk[i]);
			}
		}
	}
	$scope.listclick20 = function(index){
		$rootScope.Sarr = [];
		for(var i=0;i<$rootScope.kk.length;i++){
			$scope.data = $rootScope.List20[index];
			if($scope.data == $rootScope.kk[i]['genre']){
				$rootScope.Sarr.push($rootScope.kk[i]);
			}
		}
	}
	$scope.listclick21 = function(index){
		$rootScope.Sarr = [];
		for(var i=0;i<$rootScope.kk.length;i++){
			$scope.data = $rootScope.List21[index];
			if($scope.data == $rootScope.kk[i]['genre']){
				$rootScope.Sarr.push($rootScope.kk[i]);
			}
		}
	}
	$scope.listclick22 = function(index){
		$rootScope.Sarr = [];
		for(var i=0;i<$rootScope.kk.length;i++){
			$scope.data = $rootScope.List22[index];
			if($scope.data == $rootScope.kk[i]['genre']){
				$rootScope.Sarr.push($rootScope.kk[i]);
			}
		}
	}
	$scope.listclick23 = function(index){
		$rootScope.Sarr = [];
		for(var i=0;i<$rootScope.kk.length;i++){
			$scope.data = $rootScope.List23[index];
			if($scope.data == $rootScope.kk[i]['genre']){
				$rootScope.Sarr.push($rootScope.kk[i]);
			}
		}
	}
	$scope.listclick24 = function(index){
		$rootScope.Sarr = [];
		for(var i=0;i<$rootScope.kk.length;i++){
			$scope.data = $rootScope.List24[index];
			if($scope.data == $rootScope.kk[i]['genre']){
				$rootScope.Sarr.push($rootScope.kk[i]);
			}
		}
	}
	$scope.listclick25 = function(index){
		$rootScope.Sarr = [];
		for(var i=0;i<$rootScope.kk.length;i++){
			$scope.data = $rootScope.List25[index];
			if($scope.data == $rootScope.kk[i]['genre']){
				$rootScope.Sarr.push($rootScope.kk[i]);
			}
		}
	}
	$scope.listclick26 = function(index){
		$rootScope.Sarr = [];
		for(var i=0;i<$rootScope.kk.length;i++){
			$scope.data = $rootScope.List26[index];
			if($scope.data == $rootScope.kk[i]['genre']){
				$rootScope.Sarr.push($rootScope.kk[i]);
			}
		}
	}
	$scope.listclick27 = function(index){
		$rootScope.Sarr = [];
		for(var i=0;i<$rootScope.kk.length;i++){
			$scope.data = $rootScope.List27[index];
			if($scope.data == $rootScope.kk[i]['genre']){
				$rootScope.Sarr.push($rootScope.kk[i]);
			}
		}
	}
	$scope.listclick28 = function(index){
		$rootScope.Sarr = [];
		for(var i=0;i<$rootScope.kk.length;i++){
			$scope.data = $rootScope.List28[index];
			if($scope.data == $rootScope.kk[i]['genre']){
				$rootScope.Sarr.push($rootScope.kk[i]);
			}
		}
	}
	$scope.listclick29 = function(index){
		$rootScope.Sarr = [];
		for(var i=0;i<$rootScope.kk.length;i++){
			$scope.data = $rootScope.List29[index];
			if($scope.data == $rootScope.kk[i]['genre']){
				$rootScope.Sarr.push($rootScope.kk[i]);
			}
		}
	}
	$scope.listclick30 = function(index){
		$rootScope.Sarr = [];
		for(var i=0;i<$rootScope.kk.length;i++){
			$scope.data = $rootScope.List30[index];
			if($scope.data == $rootScope.kk[i]['genre']){
				$rootScope.Sarr.push($rootScope.kk[i]);
			}
		}
	}
	$scope.listclick31 = function(index){
		$rootScope.Sarr = [];
		for(var i=0;i<$rootScope.kk.length;i++){
			$scope.data = $rootScope.List31[index];
			if($scope.data == $rootScope.kk[i]['genre']){
				$rootScope.Sarr.push($rootScope.kk[i]);
			}
		}
	}
	
})